<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!

php artisan make:controller IndexController

php artisan make:model Admin/Productoptioninfo
|
*/

use Illuminate\Support\Facades\Route;

//前台登录页
Route::get('/login.html', "User\IndexController@login");
//用户登录提交
Route::post('/user/login', "User\ConnonController@login");
//前台注册页
Route::get('/register', "User\IndexController@register");
//用户注册提交
Route::post('/user/register', "User\ConnonController@register");
//签到
Route::get('/user/signin', "IndexController@signin")->middleware('CheckUserLogin');
//签到记录
Route::post('/history/signin', "IndexController@historysignin")->middleware('CheckUserLogin');
//首页
Route::get('/', "IndexController@index")->middleware('CheckUserLogin');
//首页
Route::get('/index.html', "IndexController@index")->middleware('CheckUserLogin');
//房间创建
Route::get('/creator.html', "IndexController@creator")->middleware('CheckUserLogin');
//房间编辑
Route::get('/editroom.html', "IndexController@editroom")->middleware('CheckUserLogin');
//个人信息
Route::get('/userinfo.html', "IndexController@userinfo")->middleware('CheckUserLogin');
//信息查看
Route::get('/user/info.html', "IndexController@getinfo")->middleware('CheckUserLogin');
//聊天图片接口
Route::post('/user/uplogo', "User\ConnonController@upmsgimg")->middleware('CheckUserLogin');
//B64图片接口
Route::post('/user/b64img', "User\ConnonController@b64img")->middleware('CheckUserLogin');
//信息修改
Route::post('/user/infoedit', "User\ConnonController@infoedit")->middleware('CheckUserLogin');
//用户头像修改
Route::post('/user/upimg', 'User\ConnonController@upimg')->middleware('CheckUserLogin');
//创建房间
Route::post('/user/addroom', 'User\ConnonController@addroom')->middleware('CheckUserLogin');
//禁言拉黑接口
Route::post('/user/punish', 'User\ConnonController@punish')->middleware('CheckUserLogin');
//签到记录
Route::post('/user/qd', "User\ConnonController@userqd")->middleware('CheckUserLogin');
//升级
Route::post('/user/lv', "User\ConnonController@userlv")->middleware('CheckUserLogin');
//房间解散
Route::post('/user/delroom', "User\ConnonController@delroom")->middleware('CheckUserLogin');
//房间编辑
Route::post('/user/editroom', "User\ConnonController@editroom")->middleware('CheckUserLogin');


//后台
Route::get('/admin', 'Admin\IndexController@box')->middleware('CheckLogin');
Route::prefix('/admin')->group(function () {
    //后台登录验证
    Route::post('/login', 'Admin\LoginController@login');
    //后台登录页面
    Route::get('/login.html', 'Admin\IndexController@login');
    //后台页面
    Route::get('{page}.html', 'Admin\IndexController@page')->middleware('CheckLogin');

    //保存网站配置
    Route::post('webset', 'Admin\DeedController@webset')->middleware('CheckLogin');
    //保存通讯服务器配置
    Route::post('server', 'Admin\DeedController@server')->middleware('CheckLogin');
    //用户头像上传
    Route::post('upimg', 'Admin\DeedController@upimg')->middleware('CheckLogin');
    //用户信息保存
    Route::post('userinfo', 'Admin\DeedController@userinfo')->middleware('CheckLogin');
    //用户删除 
    Route::post('userdel', 'Admin\DeedController@userdel')->middleware('CheckLogin');
    //房间删除
    Route::post('roomdel', 'Admin\DeedController@roomdel')->middleware('CheckLogin');
    //禁言/黑名单删除
    Route::post('punishdel', 'Admin\DeedController@punishdel')->middleware('CheckLogin');
    //历史消息删除
    Route::post('newsdel', 'Admin\DeedController@newsdel')->middleware('CheckLogin');
    //升级等级添加 
    Route::post('lvadd', 'Admin\DeedController@lvadd')->middleware('CheckLogin');
    //升级等级删除
    Route::post('lvdel', 'Admin\DeedController@lvdel')->middleware('CheckLogin');
    //积分奖励设置
    Route::post('reward', 'Admin\DeedController@reward')->middleware('CheckLogin');
});
